<?php
/**
 * Created by JetBrains PhpStorm.
 * User: Nuiz
 * Date: 29/6/2556
 * Time: 7:16 น.
 * To change this template use File | Settings | File Templates.
 */

header("Content-type: application/json");

$data = json_decode($_POST['data']);
Notify::mail($data->to, $data->subject, $data->message);

echo json_encode(array('success'=>true));

$size = ob_get_length();
header("Content-Length: {$size}");
ob_end_flush();
flush();

Notify::mailDo();

exit();